﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="OfflineExams.aspx.cs" Inherits="School.Pages.Teaching.OfflineExams" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            <div id="displaybox">
                <div>
                    جارى تنفيذ الأمر</div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <script type="text/javascript">
        function OpenReport() {
            window.open("IncomeReport.aspx", "تقرير الإيرادات", "height=500,width=600");
        }
    </script>
    <div class="devheader">
        الإمتحانات التحريرية</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlSearch" CssClass="clr fieldsettd" runat="server">
                <fieldset style="border: 1px solid #CCC">
                    <div id="hideshow">
                        <div class="col1">
                            <ul>
                                <li>المجمع
                                    <div class="field">
                                        <asp:DropDownList ID="ddlCampus" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Name" DataValueField="Id" OnTextChanged="ddlCampus_TextChanged"
                                            Width="150px">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlCampus"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>الشهاده
                                    <div class="field">
                                        <asp:DropDownList ID="ddlCertificate" runat="server" AppendDataBoundItems="True"
                                            AutoPostBack="True" DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlCertificate_SelectedIndexChanged"
                                            Width="150px" TabIndex="1">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCertificate"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>المرحله
                                    <div class="field">
                                        <asp:DropDownList ID="ddlStadge" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlStadge_SelectedIndexChanged"
                                            Width="150px" TabIndex="2">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddlStadge"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        <div class="col2">
                            <ul>
                                <li>الصف
                                    <div class="field">
                                        <asp:DropDownList ID="ddlGrade" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                            DataValueField="Id" Width="150px" TabIndex="3" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlGrade"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>اسم الإمتحان
                                    <div class="field">
                                        <asp:DropDownList ID="ddlExam" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlExam_SelectedIndexChanged">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlExam"
                                            Display="Dynamic" ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="e"
                                            InitialValue="0">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </fieldset>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div class="clr">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <div align="center">
                    <asp:Label ID="lbltst" runat="server"></asp:Label></div>
                <asp:Panel ID="Panel1" runat="server" Visible="False">
                    <asp:GridView ID="gvExam" runat="server" AutoGenerateColumns="False" Width="100%"
                        CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                        PagerStyle-CssClass="GridPager" AlternatingRowStyle-CssClass="GridItemAltername"
                        DataKeyNames="Id" ShowFooter="True">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="ch" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Subject_Name" HeaderText="المادة" />
                              <asp:TemplateField HeaderText="تاريخ الأمتحان" SortExpression="Min">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
                                    <asp:CalendarExtender ID="txtToDate_CalendarExtender" runat="server" Enabled="True"
                                        TargetControlID="txtDate" Format="yyyy-MM-dd">
                                    </asp:CalendarExtender>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="مدة الأمتحان" SortExpression="Min">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtDuration" runat="server"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الدرجة الصغرى">
                                <ItemTemplate>
                                    <asp:TextBox ID="TxtMin" runat="server">
                                    </asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtMin"
                                        Display="Dynamic" ErrorMessage="CompareValidator" ForeColor="Red" Operator="DataTypeCheck"
                                        Type="Double" ValueToCompare="e">ادخل درجة</asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الدرجة الكبرى">
                                <FooterTemplate>
                                    <asp:Button ID="btnsaveExam" runat="server" OnClick="btnsaveExam_Click" Text="حفــــــــظ"
                                        ValidationGroup="e" />
                                </FooterTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="TxtMax" runat="server">
                                    </asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtMax"
                                        Display="Dynamic" ErrorMessage="CompareValidator" ForeColor="Red" Operator="DataTypeCheck"
                                        Type="Double" ValueToCompare="e">ادخل درجة</asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                          
                        </Columns>
                        <FooterStyle CssClass="GridHeaderFooter" />
                        <HeaderStyle CssClass="GridHeaderFooter" />
                        <PagerStyle CssClass="GridPager" />
                    </asp:GridView>
                </asp:Panel>
                <asp:Label ID="lblgrid" runat="server" Visible="False"></asp:Label>
                <br />
                <fieldset visible="false" id="fgin" runat="server" style="border: 1px solid #CCC;
                    clear: both">
                    <legend>المواد المضافة </legend>
                    <asp:GridView ID="gvinExam" runat="server" AutoGenerateColumns="False" Width="100%"
                        CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                        PagerStyle-CssClass="GridPager" AlternatingRowStyle-CssClass="GridItemAltername"
                        DataKeyNames="Id" ShowFooter="True" OnRowCancelingEdit="gvinExam_RowCancelingEdit"
                        OnRowDeleting="gvinExam_RowDeleting" OnRowEditing="gvinExam_RowEditing" OnRowUpdating="gvinExam_RowUpdating">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="الاختبار" ReadOnly="True" SortExpression="Name" />
                            <asp:BoundField DataField="Subject_Name" HeaderText="المادة" ReadOnly="True" />
                            <asp:TemplateField HeaderText="تاريخ الأمتحان" SortExpression="Min">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtDate" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox>
                                    <asp:CalendarExtender ID="txtToDate_CalendarExtender" runat="server" Enabled="True"
                                        TargetControlID="txtDate" Format="yyyy-MM-dd">
                                    </asp:CalendarExtender>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Date") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="مدة الأمتحان" SortExpression="Min">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtDuration" runat="server" Text='<%# Bind("Duration") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Duration") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الدرجة الصغري" SortExpression="Min">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtmin" runat="server" Text='<%# Bind("Min") %>'></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator30" runat="server" ControlToValidate="txtmin"
                                        Display="Dynamic" ErrorMessage="CompareValidator" ForeColor="Red" Operator="DataTypeCheck"
                                        Type="Double">ادخل درجة</asp:CompareValidator>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator93" runat="server" ControlToValidate="txtmin"
                                        ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Min") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الدرجة الكبري" SortExpression="Max">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtmax" runat="server" Text='<%# Bind("Max") %>'></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator31" runat="server" ControlToValidate="txtmax"
                                        Display="Dynamic" ErrorMessage="CompareValidator" ForeColor="Red" Operator="DataTypeCheck"
                                        Type="Double">ادخل درجة</asp:CompareValidator>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtmax"
                                        ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Max") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField CancelText="الغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحديث" />
                            <asp:CommandField DeleteText="حذف" ShowDeleteButton="True" />
                        </Columns>
                        <FooterStyle CssClass="GridHeaderFooter" />
                        <HeaderStyle CssClass="GridHeaderFooter" />
                        <PagerStyle CssClass="GridPager" />
                    </asp:GridView>
                </fieldset>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
